package ch.jamme.conf;

/**
 * Defines a strategy to decide whether a given field should be treated as a primitive (a single plain value) field 
 * or as a complex one that needs to be recursively introspected in its own fields
 * @author Mario Fusco
 */
public interface FieldPrimitiveStrategy {
	
	/**
	 * Returns true if a field belonging to the given Class and having the given name and value 
	 * should be considered as primitive and then no furtherly introspected
	 * @param containingClass - The class of the object containing the field to be marshalled
	 * @param name The name of the field to be marshalled
	 * @param value The value of the field to be marshalled
	 * @return True if the field belonging to the given Class and with the given name and value is a primitive one
	 */
	boolean isPrimitive(Class<?> containingClass, String name, Object value);

	/**
	 * Returns true if a field of the given Class should be considered as primitive and then no furtherly introspected
	 * @param fieldClass The Class of the field to be declared as primitive or not
	 * @return True if the given Class is a primitive one
	 */
	boolean isPrimitive(Class<?> fieldClass);
}
